package com.jt.www.enums.woxuebao;

/**
 * 线下批量投保状态
 *
 * @author admin_ltf
 * @create 2019-06-04 10:26
 */
public enum HandlerStatusEnum {
    NO_INS("未投保", 0),
    SUCCESS_INS("投保成功", 1),
    FAIL_INS("投保失败", 2),
    OVER("请求超时", 3),
    REPETITION_INS("重复的投保单", 5),
    LOSE_EFFICACY("保单失效", 6);

    private String msg;
    private int code;

    HandlerStatusEnum(String msg, int code) {
        this.msg = msg;
        this.code = code;
    }

    public static String getMsgByCode(Integer code) {
        if (null == code) {
            return "";
        }
        for (HandlerStatusEnum handlerStatusEnum : HandlerStatusEnum.values()) {
            if (code == handlerStatusEnum.code) {
                return handlerStatusEnum.msg;
            }
        }
        return "";
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
